package com.luhuiguo.gwt.mvp.dispatcher.client;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.luhuiguo.gwt.mvp.dispatcher.server.Dispatcher;
import com.luhuiguo.gwt.mvp.dispatcher.shared.rpc.Action;
import com.luhuiguo.gwt.mvp.dispatcher.shared.rpc.Result;

/**
 * This is an asynchronous equivalent of the {@link Dispatcher} interface on the
 * server side. The reason it exists is because GWT currently can't correctly
 * handle having generic method templates in method signatures (eg.
 * <code>&lt;A&gt; A
 * create( Class<A> type )</code>)
 * 
 * @author LuHuiguo
 * @version $Id: DispatcherAsync.java 11 2009-12-26 13:39:17Z luhuiguo $
 */
public interface DispatcherAsync {

    public final static String DISPATCHER = "dispatcher";

    <A extends Action<R>, R extends Result> void execute(A action, AsyncCallback<R> callback);
}
